home *** CD-ROM | disk | FTP | other *** search
/ New York Knicks / New York Knicks.iso / browsers / ns / 32 / nav40.z / resdll.dll / RCDATA / INIT_PREFS < prev    next >
Text File  |  1998-03-24  |  2KB  |  69 lines

  1. // Style note 3/3:
  2. // internal objects & functions are in under_score form.
  3. // public functions are in interCaps.
  4.  
  5. // Remove this -- but called in winpref.js :
  6. // platform.windows = true;
  7. function plat() {
  8.     this.windows=false;
  9.     this.mac=false;
  10.     this.unix=false;
  11. };
  12. platform = new plat();
  13.  
  14. /* --- Preference initialization functions ---
  15.  
  16.     Moved to native functions:
  17.     pref        -> pref_NativeDefaultPref
  18.     defaultPref -> "
  19.     userPref    -> pref_NativeUserPref
  20.     lockPref    -> pref_NativeLockPref
  21.     unlockPref    -> pref_NativeUnlockPref
  22.     getPref        -> pref_NativeGetPref
  23.     config        -> pref_NativeDefaultPref    (?)
  24. */
  25.  
  26. // stubs for compatability
  27. var default_pref = defaultPref;
  28. var lock_pref = lockPref;
  29. var unlock_pref = unlockPref;
  30. var userPref = user_pref;
  31.  
  32. // -------------------------
  33.  
  34. function mime_type(root, mimetype, extension, load_action, appname, appsig, filetype)
  35. {
  36.     // changed for prefbert
  37.     pref(root + ".mimetype", mimetype);
  38.     pref(root + ".extension", extension);
  39.     pref(root + ".load_action", load_action);
  40.     pref(root + ".mac_appname", appname);
  41.     pref(root + ".mac_appsig", appsig);
  42.     pref(root + ".mac_filetype", filetype);
  43.     pref(root + ".description", "");
  44.     pref(root + ".latent_plug_in", false);
  45. }
  46.  
  47. // LDAP
  48. // Searches for "key=value" in the given string and returns value.
  49. function getLDAPValue(str, key)
  50. {
  51.     if (str == null || key == null)
  52.         return null;
  53.         
  54.     var search_key = "\n" + key + "=";
  55.  
  56.     var start_pos = str.indexOf(search_key);
  57.     if (start_pos == -1)
  58.         return null;
  59.         
  60.     start_pos += search_key.length;
  61.         
  62.     var end_pos = str.indexOf("\n", start_pos);
  63.     if (end_pos == -1)
  64.         end_pos = str.length;
  65.     
  66.     return str.substring(start_pos, end_pos);
  67. }
  68.